#include <stdio.h>
#include <string.h>
#include <stdlib.h>
#include <errno.h>
#include <syslog.h>
#include "pppoe-server.h"
#include "logging.h"

int log_option = LOG_CONS | LOG_PID | LOG_PERROR;
int log_facility = LOG_DAEMON;                      // change to LOG_USER when debugging

void pppoe_warning(char *waring)
{
    char buf[SMALL_BUF_SIZE];
    snprintf(buf, SMALL_BUF_SIZE, "%s", warning);
    syslog(LOG_WARNING, buf);
}

void pppoe_fatal(char *fatal_info)
{
    char buf[SMALL_BUF_SIZE];
    snprintf(buf, SMALL_BUF_SIZE, "%s: %s", strerror(errno));
    syslog(LOG_ERR, buf);
    control_exit();
    exit(EXIT_FAILURE);
}

